
import React from 'react';
import { inject, observer } from 'mobx-react';
// import {weaTab} from "ecCom";
import { WeaTableNew } from "comsMobx";
const WeaTable = WeaTableNew.WeaTable;

@inject('agreedBillStore','synergyStore')
@observer
export default class AgreedBill1 extends React.Component {
	constructor(props){
		super(props);
	}

	// componentWillMount(){
	// 	const {otherParams} = this.props.synergyStore;
	// 	console.log(otherParams);
	// }

	componentDidMount(){
		const {otherParams,initInfo} = this.props.synergyStore;
		const {getAgreedBills} = this.props.agreedBillsStore;
		const reqParams = {contractid:initInfo.refId};
		getAgreedBills(reqParams);
	}
	
	render() {
		const payType = this.props.payType||'1';//{1:收入，0：支出}
		const {tableStore} = this.props.agreedBillsStore;
		tableStore.columns.map((fields,index)=>{
			//根据合同性质，修改标题
			if(payType==='1')
				fields.title = fields.title.replace('付','收');
			else{
				fields.title = fields.title.replace('收','付');
			}
		});

		let weaTableProps = {};//WeaTable中的属性集
        weaTableProps.comsWeaTableStore = tableStore;
        weaTableProps.hasOrder = true;
        weaTableProps.needScroll = true;

        let tableCom = <WeaTable  {...weaTableProps} /> 

		return (
			<div>
				{tableCom}
			</div>
		)

	}

}